package cn.wyu.blog;

import javafx.geometry.Pos;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class PostDAO {
    private List<Post> posts = new ArrayList<>();

    public void add(Post post){
        this.posts.add(post);
    }

    public List<Post> list(){
        return this.posts;
    }

    public void remove(String uuid){
        for(int i=0;i<this.posts.size();i++){
            if(uuid.equals(posts.get(i).getUuid()))
                this.posts.remove(i);
        }
    }
}
